home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: accessing structures (newbie question)
- Date: 21 Feb 1996 15:31:16 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb21083116@qcd.lanl.gov>
- References: <4g8gic$o6u@news1.sunbelt.net> <3128FA60.5227@metagen.co.uk>
- <TANMOY.96Feb19090845@qcd.lanl.gov> <4geju0$sif@maureen.teleport.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: GHouck's message of 21 Feb 1996 08:08:32 GMT
-
- In article <4geju0$sif@maureen.teleport.com> GHouck
- <hksys@teleport.com> writes:
- <snip>
- tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) wrote:
- [snip]
- >What nonsense! Anything creates trouble if you do not take the time
- >to understand it.
- >
- > I think you may have been using the wrong syntax when you tried the array
- > method. The xth item is given by 'photos[x].' which is equivalent to
- > '(photos + x * sizeof(picture))->'.
- >
- >This is the problem!!! photos[x]. is always the same as (photos + x)->
- >In fact, this is such a basic fact of pointer arithmetic that anyone
- >who posts such nonsense must surely be trying to deliberately mislead
- >newbies. We have enough confusion here: please refrain from posting
- >_answers_ unless you know at least the basics of C!
- >
- Tanmoy,
-
- Speaking of nonsense (your word), what is the meaning of your statement:
-
- > '(photos + x * sizeof(picture))->'. ?
-
- It may make sense conceptually, but syntactically you will step thru
- the array of structures rather quickly (by a factor of sizeof(picture)).
- Unless I'm mistaken, did you not mean:
- > '(photos+x)->' ?
- To use your cordial words: 'We have enough confusion here: please refrain
- from posting _answers_ unless you know at least the basics of C!'
-
- Yours, Geoff Houck
-
- If you can't distinguish a quote from a comment, please read a few
- more days before posting. It will help you not to make a fool of
- yourself. Your confusion certainly does not help dispell the confusion
- around.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-